Copyright: ® Softech Systems 1995-96


Introduction
Visual Basic™ FlexiButton v1.3

Softech Systems

Help Release Edition: 002145/SSFB13

Welcome to FlexiButton 1.3, a Softech Systems plug-in code module for Visual Basic programmers.

FlexiButton is a single self contained .bas file which can be inserted into your existing  VB application and with a few procedure calls you too could be well on your way to creating arrays of custom command buttons utilising minimal resources.

FlexiButton is written entirely in Visual Basic code - no .dlls or .vbxes are required.  Not even 3D rendering .vbxes are needed. No 'light-weight' control arrays (image, labels or otherwise are necessary). This, you will agree is a more efficient solution to the age old problem of  resource overhead, potential unpredictable general protection faults/bugs, extra-distribution files and associated compatibility/installation problems that may arise out of a .vbx substitute.

FlexiButton also allows you to create command buttons that stand out. Create 3D buttons that support 2D or 3D text,  different caption colors, with varying degrees of rounded corners/bevel widths - all features that common VB buttons do not support. Create completely round buttons at a stroke. Select from the new Windows look or the more traditional button face of yester year. In addition to the packed features you have complete control of the code: extend the procedures to your specific requirements: That's 100% flexibility!

Included in this help file is a brief on FlexiButton v1.3. Should you have any queries or comments we can be contacted on the address below  (See copyright notice).

  ________________

Click topics of interest:

FlexiButton Overview

Why Use FlexiButton?

Standard Edition VB Requirements

The FlexiButton Code Wizard

Ordering Information

  ________________

©Softech Systems (UK) 1995-6

Microsoft Windows and MS-DOS are registered trademarks of Microsoft Corporation.

All other product names are trademarks, registered trademarks, or service marks of their respective owners.


FlexiButton Overview

FlexiButton emulates a custom control by using the popular  property setting analogy in procedure calls .

Some properties can be dynamically set at run-time during procedure calls (Run-Time Properties) while others must be assigned constants and retain this fixed value during program execution (Design-Time Properties).

Run-Time Properties

Design-Time Properties

Once drawn, the command button can respond to the user in terms of keyboard and  mouse interaction :

- Detect which button the mouse has clicked

- Detect which button is depressed by the ENTER or SPACE BAR.

- Using arrow keys, navigate in real 2D (i.e.. up, down, right and  left as you would in  e.g. grid control).

- Retain focus of the last accessed button when using TAB to shift control focus.

- Use TAB to proceed to next button in array (only when all other control's tabstop property are set to false - this is a VB limitation!).

- Use shortcut keys (the +CTRL accelerator) if the form's keypreview property is set to true.


Design - Time Properties

The following properties affect all the buttons collectively contained in the array and are assigned constants at design time which are implemented throughout program execution.

Focus Rectangle

An option to display a focus rectangle on the currently selected button in the array.

Focus Outline

An option to display a focus outline around each button.

Focus Outline

Specify a color for the focus outline using the color of your choice.

System Colors

Use this flag to indicate whether you wish to override and use the Windows system button color defaults for the buttons created in the array.


Run-Time Properties

The following is a list of property settings affecting all the buttons collectively  contained in the array. They are implemented at run-time.

Button Width

Set the button width required for the buttons in the array.

Button Height

Set the button height required for the buttons in the array.

Horizontal Gap

Set the space between adjacent buttons in a row.

Vertical Gap

Set the space between adjacent buttons in a column.

Rows

Set the number of rows required for the button array.

Cols

Set the number of columns required for the button array.

Corner

In virtually all other third party custom controls, the rounded corner property is available  with a  limited effect. However, with FlexiButton, you have the option of adding different extents of curvature on the corner appearance. By setting the button width = button height and the value of corner to half that, you can create a circular button.

Bevel Width

Set the extent of the bevel of the buttons.

Outline Style

You can now have buttons with or without a black outline and an option for the  new Windows 95 look.

Face Color

Specify any color for the surface of the buttons in the array.

Backcolor

Specify any color for the background of the button array.

Caption Effects

For the sake of uniformity in your application, an option for different text effects is available. This allows the array of buttons to blend with your application's other command buttons. Choose from Flat, Raised Light, Raised Heavy, Inset Light and Inset Heavy.

Caption FontStyle

Choose your own font style from the installed Windows fonts.

In addition for each button in your array you specify the following run-time properties:

Caption

Set the caption for each button. The  underscore ampersand (&) accelerator can be included.

Caption Color

Set the caption color for each button.

Caption Alignment

Set the horizontal alignment - left, center or right.

Visible

Now you can explicitly set the visible property to false for any button in the array. This allows non-contiguous arrays of buttons for special formatting requirements.


Standard Edition VB Requirements
VB Requirements

Question: What Standard Edition VB Controls Do I Need?

Answer:  One picturebox

Yes! That's it ! Just add one picturebox, append the  .bas file, call the procedures according to property settings and you're off !

You can even create multiple button arrays using a number of pictureboxes but the same .bas file with no modification whatsoever.


FlexiButton Code Wizard

Included with this .zip file is a program enabling you to get the most out of FlexiButton v1.3.

The FlexiButton Code Wizard is an accessory  multi-faceted program providing:

- an illustration of  the various features available in the FlexiButton code package.

- the option of generating a plethora of button styles in an instant.

- once you've registered your product, it provides a very useful utility for generating the required source code for FlexiButton usage.

The 3 main sections are:

> PROPERTY:

Use this window to designate the property settings you require for FlexiButton.

> WYSIWYG VIEWPORT:

Once you've set your properties, click on 'CREATE!'  to immediately see how your button's will appear in your program. The viewport is a separate entity altogether, provided for your convenience during design time [It is not supported by FlexiButton code module proper].

> CODE GENERATOR:

Once content with your collection of buttons/appearance then use the code generator to quickly produce precise code for you to copy and drop into your application - you're ready and running in a couple of minutes.

> NOTE:   SELECT HELP TIPS CHECK BOX AND POSITION THE MOUSE OVER THE CONTROL TO PRODUCE ON SCREEN 'MINI-HELP'.


Ordering Information
Note: Genuine Limited Offer.

Prices increase after 31st May 1996. You already have FlexiButton v1.3 in your hard disk, just gotta UnZip !

Don't leave it till May, Register today !!!

__________________

FlexiButton v1.3 is only $29 !!!

__________________

We are currently processing orders via CompuServe's SWREG :

In CompuServe,

1. Type GO SWREG.

2. Select REGISTER SHAREWARE.

3. Select your 'Geographic Region' from the displayed list.

4. Select 'Registration ID' from the list. Enter FlexiButton's Registration ID number : 10800 and click OK.

4. Select 'Display Selected Titles' to find this product.

5. FlexiButton v1.3 costs $29. Price applicable until 31-May-96.

Click here for postal orders:...

Postal Orders

Upon ordering, you will receive a password that unlocks the code file FLXBTN13.ZIP which you currently have in the directory containing this helpfile. The module FLXBTN13.BAS contained therein is a commented code module ready for use.

Additional licenses for multi-developer sites are available at a reduced rate.

By placing an order you indicate your agreement with the license information below .

License Agreement

This is a legal agreement between you and Softech Systems. By unlocking the password protected FLXBTN13.ZIP file you agree to be bound by the terms of this agreement. In this agreement:

-  "CODE" refers to the code module FLXBTN13.BAS included in FLXBTN13.ZIP.

- "use" of  the CODE is considered to occur when a person

(a) places any CODE routines into a Visual Basic program,

(b) calls a CODE routine from within a program,

(c)  reads any CODE with the intent to use it or similar code, or

(d) uses any routine derived from the CODE . Any person who performs any of these tasks is considered to be a FLEXIBUTTON 1.3 user and must obtain their own license and agree to  its terms.

Grant of License

SOFTECH SYSTEMS grants you the right to make changes to the original CODE for your  own programming needs.  Such modifications are considered to be derivative works of the CODE and are also protected by European, U.S. and International copyright laws.  Any code that you produce that is a modification of, or is derived from FLEXIBUTTON 1.3, is also covered under this license agreement.

You are licensed to distribute, royalty free, any application that you develop using the CODE provided that

(a) you do so as an executable program only; and

(b) you agree to indemnify and hold harmless SOFTECH SYSTEMS against any claims or lawsuits that arise from the use of your software product.

You may make copies of the CODE and written material to facilitate your personal use of it.  You may not distribute the CODE, its derivatives, or its written material to anyone unless they themselves are a licensed FLEXIBUTTON 1.3  user.

You may transfer ownership of FLEXIBUTTON 1.3  provided that

(a) you transfer all FLEXIBUTTON 1.3  materials including all copies of disks, written material, and present and prior versions;

(b) you agree not to reconstruct or create any code that could be considered a derivative of FLEXIBUTTON 1.3  ; and

(c) the recipient agrees to the terms of this agreement.

NO OTHER WARRANTIES

SOFTECH SYSTEM disclaims all other warranties, either expressed or implied of merchantability or fitness for a particular purpose with respect to the CODE. SOFTECH SYSTEMS and LIBERTY MARKETING will not be liable to any person or entity with respect to any liability, loss, or damage caused or alleged to have been caused directly or indirectly by the use of the CODE.  The use of the CODE is entirely at your own risk.

DISTRIBUTION POLICY:

FlexiButton v1.3 is distributed SOLELY BY SOFTECH SYSTEMS and LIBERTY MARKETING(UK) via COMPUSERVE and Internet Site: ftp.winsite.com: /pub/pc/win3/programr/vbasic and direct mail (via Liberty Marketing). Strictly, no other company, disk vendor, user clubs or otherwise may represent or sell this product. We would like to know if anyone is !

A considerable effort is taken in providing an accurate account of FLEXIBUTTON v1.3  but ultimately, neither Softech Systems or Liberty Marketing (UK) will be held responsible for errors or omissions.


Why Use FlexiButton?

Introduction

If you require a few common command buttons dotted around the form then use those shipped with VB. However, FlexiButton is a command button arsenal. It provides an  invaluable addition to your current code library  as it hands you the power to incorporate many command buttons / responsive selection panels  whilst still maintaining  a high degree of aesthetic appeal and fast program execution. With the versatile property settings, FlexiButton has been designed to neatly blend in with other form controls and command buttons - so the end user will never tell the difference! Even your colleagues  will be duped!

See for yourself !

Ever tried placing a series of buttons, e.g. basic rolodex-style, for your forms and seen  the repaint on your client's -Mr. Sam, with not enough RAM- machine. Ugh! A slow process! And have you ever set up a series of buttons only to change the outlay again, button by button - that's time-wasting! Form design is easier with FlexiButton! Would you seriously justify the addition of a .vbx and the resources associated with it for designer buttons? With FlexiButton you can - it's a tool for that polished look. And can you seriously resize the buttons in a flash - you can with FlexiButton. Just change the values for one line. It's easy!

FlexiButton at work ...

FlexiButton has been designed to mimic the command buttons as closely as possible in their function and responsiveness. It has a quick painting and refresh time that is comparable, if  not superior to the loading of equivalent VB buttons (see table below). The feedback from FlexiButton is equivalent to the returned index property of conventional VB control arrays. When the user depresses a  button, FlexiButton will notify your code of the index number of the selected button . An index of -1 indicates that a non-button region selected viz: a gap between the buttons or a non visible button.

Hey! Good-looking ...

FlexiButton also allows you to create 3D buttons supporting flat or 3D text, different caption colors, with varying degrees of true rounded corners/ bevel widths - all features that VB buttons alone do not support.

Where's the catch?

Having read this far, you will be forgiven for anticipating a massive  memory-hogging module lugging in your application. Fortunately, this is not so. FlexiButton is a neat small  .bas file - two words describe it best: FAST & FLEXIBLE !

Code Profile

-Absolutely no global variables.

-Event code is kept to a minimum.

-Procedure calls are kept to a minimum.

-Only one module with reusable code is required per application.

-FlexiButton doesn't require huge arrays.

-FlexiButton stores all that it needs in the tag property of the picturebox(max. 40 characters only!).  Create over a hundred fully working buttons, with captions and different caption colors/ alignment properties and you won't find one storage dynamic array variable in code!

That's real power!

Some statistics...

A comparison of performance was carried out on 486SX Machine, 8MB RAM with Windows 3.11 and InfoSpy v2.42 (for measuring System, GDI & User  data). The following results were obtained:

---------------------------------------

RESULTS OF LOADING AN ARRAY USING VB COMMAND

BUTTONS (in red) AND FlexiButton v1.3 (in blue):

Loading Time and %Resource

Buttons     Time/secs              GDI%            USER%         SYSTEM%       SYS Mem%

0                  0.0      0.0               68       68          80       80         68        68            84       84

10                0.2      0.2               68       66          80       80         68        66            84       84

25                0.9      0.3               66       66          80       80         66        66            84       84

50                2.7      0.8               64       66          78       80         64        66            84       83

75                5.6      1.2               62       66          75       80         62        66            84       83

100              9.7      1.2               61       66          71       80         61        66            84       83

125              16.1    1.4               61       66          68       80         61        66            84       83

150              23.4    1.7               59       66          65       80         59        66            84       83

175              24.9    2.1               59       66          61       80         59        66            84       82

200              25.8    2.5               59       66          58       80         58        66            84       82

250              26.6    3.2               59       66          51       80         51        66            83       82

300              28.4    3.8               59       66          45       80         45        66            83       81

350               29.7     4.6                59        66          38        80         38         66             83        81

400               31.3     5.0                59        66          31        80         31         66             83        81

Note: Figures indicate free resource at steady state after the creation of button array. Test performed using 'typical' button dimensions of 60x30 pixels with no inter-button gaps. Differences  between common VB and  FlexiButton command button arrays will be lower for larger button dimensions because pictureboxes will need to be larger to accomodate them - this will affect mainly GDI% & System%. The converse is also true: smaller buttons will have u sed up slightly less resources. Tests performed on compiled *.exe file. Also, in general, command buttons generated  by third party *.vbxes were found to take more resources.

You should have seen the repaints- FlexiButton had no competition !

---------------------------------------

We think the results speak for themselves!!!

The size of the FlexiButton v1.3 commented design-time code module is 49KB, after compilation, this approximates to 17KB only. Beat that .vbxers!


Softech Systems

c/o Liberty Marketing

P.O.Box 422

LEICESTER.

ENGLAND, UK.

LE2 3ZJ.

E-Mail: 100420,1230 @ compuserve.com


Registration Form

For postal orders,  use the following address. Our preferred method of payment is by cheque drawn in pounds sterling payable in London to ' SOFTECH SYSTEMS ' . The check should be made to the amount of   'FIFTEEN POUNDS STERLING AND FIFTY PENCE'. (Pounds Sterling 15 - 50 ). Unfortunately, paying in US Dollars incurs an additional currency transfer  charge, currently an extra fifteen US dollars ( USD 15 - 00 ).

SOFTECH SYSTEMS

c/o Liberty Marketing (U.K.)

P.O.Box 422

LEICESTER

LE2 3ZJ

ENGLAND

UNITED KINGDOM

Please attach this Registration Form with a check or international postal money order. Allow aminimum of seven days for delivery upon receipt of payment.

Name:....................................................................................................................................................

Company:.............................................................................................................................................

Address:...............................................................................................................................................

City,State,Zip:......................................................................................................................................

Country:.................................................................................................................................................

E-Mail: ...................................................................................................................................................

Tel No: ...............................................................

Fax No:  .............................................................

Date:....................................................................

Where did you find out about FlexiButton v1.3?

....................................................................................................................................................................

Thankyou for your custom!